// checksum 0x9a77 version 0x30001

///////////////////////////////////////////////
//Author: Juhapekka Piiroinen
//License: GPLv3
//Webpage: http://code.google.com/p/cutechat
///////////////////////////////////////////////

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "QXmppClient.h"
#include "QXmppLogger.h"
#include "QXmppMessage.h"
#include "QXmppRosterManager.h"
#include "QXmppVCardManager.h"
#include "QXmppVCardIq.h"

#include <QDebug>
#include <QtGui/QMainWindow>
#include <QBuffer>
#include <QImageReader>
#include <QFile>

#include "contactpage.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    enum ScreenOrientation {
        ScreenOrientationLockPortrait,
        ScreenOrientationLockLandscape,
        ScreenOrientationAuto
    };

    explicit MainWindow(QWidget *parent = 0);
    virtual ~MainWindow();

    void setOrientation(ScreenOrientation orientation);
    void showExpanded();
    void updateRoster(QString bareJid, QString fullName, QString nickName, QImage avatar);

public slots:
    void on_pushButtonLogin_clicked();
    void on_pushButtonLogout_clicked();
    void messageReceived(QXmppMessage);
    void presenceReceived(QXmppPresence);
    void rosterReceived();
    void vCardReceived(const QXmppVCardIq& vCard);

    void sendMessage(QString msg);


private:
    Ui::MainWindow *ui;
    QXmppClient* m_client;
    QList<ContactPage*> m_contacts;
};

#endif // MAINWINDOW_H
